package com.vint.lintcode;


/**
 * A是否全部包含B, 都是大写字符
 */
public class Lintcode55 {

	/**
	 * @param A: A string
	 * @param B: A string
	 * @return: if string A contains all of the characters in B return true else return false
	 */
	public boolean compareStrings(String A, String B) {
		// write your code here
		int[] num = new int[26];
		for (char c : A.toCharArray()) {
			num[c -'A'] ++;
		}
		for (char c : B.toCharArray()) {
			num[c - 'A'] -- ;
			if (num[c -'A'] < 0)
				return false;
		}
		return true;
	}
}
